#pragma once

#include <TH1F.h>
#include <TCanvas.h>

#include <vector>

#include "ValueWithError.h"

class VisualizationWrapper
{
public:
    VisualizationWrapper() : m_canvas(NULL), m_chanelsShow(6)
    {};

    ~VisualizationWrapper()
    {
        if( m_canvas != NULL )
        {
            m_canvas->Close();
            delete m_canvas;
        }
    };

    void DrawEmpty();
    void DrawSignal(std::vector<double> signalData, double maxY, double minY, float signalStart, float signalEnd, int signal, bool filtered);
    void PrintVector(std::string name, std::vector<ValueWithError> &vals);
    void PrintVector(std::string name, std::vector<double> &vals);
    void PrintValue(std::string name, ValueWithError &val);
    void PrintValue(std::string name, double &val);

    void Configure(bool draw,  bool print);

    void CanvasClosed()
    {
        m_canvas = NULL;
    }

private:
    TCanvas* m_canvas;

    bool m_draw;
    bool m_print;
    int m_pad;
    const int m_chanelsShow;
};
